package studio.raptor.dispatcher.common.util;

/**
 * @author jack
 * @since 1.0
 */
public final class ObjectUtil {

  private ObjectUtil() {
  }

  /**
   * Checks that the given argument is not null. If it is, throws {@link NullPointerException}.
   * Otherwise, returns the argument.
   */
  public static <T> T checkNotNull(T arg, String text) {
    if (arg == null) {
      throw new NullPointerException(text);
    }
    return arg;
  }
}
